package com.lwd.util;

import com.raycloud.erp.performance.model.constant.enums.WwPrefix;
import org.apache.commons.lang.StringUtils;

/**
 * Created by hugui on 14-2-18.
 */
public class TbUtils {

    /**
     * 方法描述：聊天对象去除前缀
     */
    public static String getNick(String nick) {
        if (StringUtils.isNotEmpty(nick)) {
            for (WwPrefix wwPrefix : WwPrefix.values()) {
                if (nick.startsWith(wwPrefix.value())) {
                    return StringUtils.removeStart(nick, wwPrefix.value());
                }
            }
        }
        return nick;
    }

    /**
     *
     * @param buyerNick
     * @return false不是openUid true是openUid
     */
    public static boolean isOpenUid(String buyerNick) {
        boolean result = false;
        if (StringUtils.isNotBlank(buyerNick) && buyerNick.contains("DAAB3I7")) {
            result = true;
        }
        return result;
    }

}
